<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Aps_Mo.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/basicdata/Aps_Mo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Aps_Mo",
        setup() {
            const table = ref({
                key: "MoId",
                footer: "Foots",
                cnName: "工单信息",
                name: "basicdata/Aps_Mo",
                newTabEdit: false,
                url: "/Aps_Mo/",
                sortName: "SalesOrderId,CreateTime"
            });
            const editFormFields = ref({"SalesOrderId":"","MoCode":"","MoType":"","LotNo":"","Qty":"","ProductsCode":"","Status":"","DeadLine":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"APS_Order","data":[],"title":"订单","field":"SalesOrderId","type":"select"},
                               {"title":"工单号","field":"MoCode"}],
                              [{"dataKey":"BASE_MoType","data":[],"title":"工单种类","field":"MoType","type":"select"},
                               {"title":"投料批号","field":"LotNo"}],
                              [{"title":"产品","field":"ProductsCode"},
                               {"title":"数量","field":"Qty","type":"decimal"}],
                              [{"title":"出货日","field":"DeadLine","type":"date"},
                               {"dataKey":"BASE_MoStatus","data":[],"title":"状态","field":"Status","type":"select"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"SalesOrderId":"","MoCode":"","LotNo":"","ProductsCode":"","Status":"","IsSchedule":""});
            const searchFormOptions = ref([[{"dataKey":"BASE_MoStatus","data":[],"title":"状态","field":"Status","type":"select"},{"title":"工单号","field":"MoCode","type":"like"}],[{"title":"投料批号","field":"LotNo","type":"like"},{"title":"产品","field":"ProductsCode","type":"like"}],[{"dataKey":"APS_Order","data":[],"title":"订单","field":"SalesOrderId","type":"select"},{"dataKey":"enabled","data":[],"title":"是否已排程","field":"IsSchedule","type":"select"}]]);
            const columns = ref([{field:"SalesOrderId",title:"订单",type:"bigint",bind:{ key:"APS_Order",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"MoId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ParentId",title:"前序工单",type:"bigint",bind:{ key:"APS_Mo",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"MoCode",title:"工单号",type:"string",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"MoType",title:"工单种类",type:"int",bind:{ key:"BASE_MoType",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"LotNo",title:"投料批号",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Qty",title:"数量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Weight",title:"重量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ProductsCode",title:"产品",type:"string",width:180,showOverflowTooltip:true,align:"left"},
                       {field:"Status",title:"状态",type:"int",bind:{ key:"BASE_MoStatus",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"IsSchedule",title:"是否已排程",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"DeadLine",title:"出货日",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"FinishedQty",title:"完成数量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"FinishedWeight",title:"完成重量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialId",title:"产品",type:"bigint",bind:{ key:"WMS_Material",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Level",title:"层级，越小表示越靠近成品",type:"int",width:120,hidden:true,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
